﻿#ifndef TINYDISKCLIENT_H
#define TINYDISKCLIENT_H

#include <QWidget>
#include <QFile>
#include <QByteArray>
#include <QDebug>
#include <QMessageBox>
#include <QTcpSocket>
#include <QTimer>
#include "clientdisktcpsocket.h"
#include "protocol.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class TinyDiskClient;
}
QT_END_NAMESPACE

class TinyDiskClient : public QWidget
{
    Q_OBJECT
public:
    TinyDiskClient(QWidget *parent = nullptr);
    ~TinyDiskClient();
    static TinyDiskClient* getInstance();

    void handle_ConnectToHost(bool isConnected);
    void handle_Regist_Respond(PDU* pduRecv);
    void handle_Login_Respond(PDU* pduRecv);

    void handle_disconnectHost();


private:
    Ui::TinyDiskClient *ui;
    ClientDiskTcpSocket* m_tcpSocket = NULL;

    QString m_strLoginName;// 登录用户名

private slots:
    void on_login_pbn_clicked();
    void on_register_pbn_clicked();
    void on_cancel_pbn_clicked();
};
#endif // TINYDISKCLIENT_H
